#ifndef ITMESH_H
#define ITMESH_H
#pragma pack(push,1)

#include "assetfile/assetfilemgr.h"
#include "assetfile/formats/meshformat.h"

class	ANIMRESULT;
class	MATRIX;
class	TRANSMAT;


class ITMesh : public TMESHDATA
{
public:
	static void	*AssetInit( IAssetFile *pFile, const MasterIndexEntry *pEntry );
	static void	AssetUninit( void *ptr );
	static void	AssetFixup( ASSETFILEMGR *pMgr, const IAssetFile *pFile, void *ptr, const MasterIndexEntry *pEntry );

	static void	Register( ASSETFILEMGR *pMgr )
	{
		pMgr->AddAssetType("TMESH",AssetInit,AssetUninit,AssetFixup);
	}

public:

	bool	FindRefPoint( const char *name, u32 &pIndex ) const;
	void	ApplyAnimation( const ANIMRESULT *result, TRANSMAT *outMats ) const;
	MATRIX	&GetBoneMatrix( const ANIMRESULT &animResult, u32 idx, MATRIX &result ) const;
	MATRIX	&GetRefMatrix ( const ANIMRESULT &animResult, u32 idx, MATRIX &result ) const;
};

#pragma pack(pop)
#endif
